home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_12_09
/
allison
/
uncheck.c
< prev
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-07-10
|
379 b
|
30 lines
#include <stdio.h>
#include <string.h>
class string
{
public:
string(char *s)
{strcpy(data = new char[strlen(s)+1], s);}
operator char*()
{return data;}
private:
int dummy;
char *data;
};
main()
{
string s = "hello";
printf("%s\n",(char *) s);
printf("%s\n",s);
return 0;
}
/* Output:
hello
(null)
*/